package com.fly.entity;

import com.fly.component.validated.Insert;
import com.fly.component.validated.Update;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.math.BigDecimal;

/**
 *
 * @author ${author}
 * @date ${date}
 */
@Getter
@Setter
@ApiModel(description = "${remarks}搜索参数")
public class ${modelNameUpperCamel}Dto implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    @NotNull(message = "请输入名称", groups = Update.class)
    private Integer id;

<#list modeListDetails as item>
    <#if "${item.type}"?contains("bigint")>
    @NotNull(message = "请输入${item.remark}", groups = {Update.class, Insert.class})
    @ApiModelProperty(value = "${item.remark}")
    private Long ${item.name};

    <#elseif "${item.type}"?contains("int")>
    @NotNull(message = "请输入${item.remark}", groups = {Update.class, Insert.class})
    @ApiModelProperty(value = "${item.remark}")
    private Integer ${item.name};

    <#elseif "${item.type}"?contains("varchar")>
    @NotBlank(message = "请输入${item.remark}", groups = {Update.class, Insert.class})
    @ApiModelProperty(value = "${item.remark}")
    private String ${item.name};

    <#elseif "${item.type}"?contains("decimal")>
    @NotNull(message = "请输入${item.remark}", groups = {Update.class, Insert.class})
    @ApiModelProperty(value = "${item.remark}")
    private BigDecimal ${item.name};

    <#else>

    </#if>
</#list>

}
